package com.sm.service;

import java.util.Date;
import java.util.List;

import com.sm.model.Withdrawal;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.sm.dao.WithdrawalMapper;

@Service
public class WithdrawalService {

	@Autowired
	private WithdrawalMapper withdrawalMapper;
	
	public List<Withdrawal> selectByUserId(Integer userId){
		return withdrawalMapper.selectByUserId(userId);
	}


	public int insertSelective(Withdrawal record){
		record.setStatus(0);
		record.setWithdrawalTime(new Date());
		return withdrawalMapper.insertSelective(record);
	}
}
